1. Field of the Invention
This invention relates to the field of performing image operations on tiled images. Specifically, this invention is a method, apparatus, and computer program product for efficiently processing area-image operations that operate on a source image that extends across multiple tiles.
2. Background
Image based computer applications generally apply a selection of image operations to an input source image to generate an output destination image. These image operations include area-image operations. Area-image operations are those that generate a destination pixel by using contributions from more than one source pixel. The images operated on by these applications are often very large--typically from tens of megabytes to many gigabytes or more. Often the size of the image is larger than the volatile memory available to store the image. To process such a large image, the image is generally "tiled" so that only a portion (one or more tiles) of the image is in memory at a particular time.
To generate a destination tile, multiple source tiles often need to be accessed. This need is particularly true with "area" operations. Area-image operations are those that generate a destination pixel by using contributions from more than one source pixel. Some area-image operations apply values from a source pixel contribution map (such as a kernel array) to corresponding pixel values in one or more source tiles to generate a destination pixel value having contributions from each of the corresponding pixel values in the source tiles.
One problem with the area-image operations that are applied near a tile edge is that these area-image operations need source pixel value information from an adjacent tile to calculate each source pixel's contribution per the source pixel contribution map. In addition, the programming that implements the area-image operations is complicated by the need to provide "special-case" programming to process the edge conditions of the tile. This approach directly accesses pixel values in the tiles. However, this approach is very complex and cannot readily be implemented using specialized image processing hardware or specialized CPU instructions such as Sun's VIS or Intel's MMX accelerated CPU-based instruction sets. Thus, the prior art assembles a memory buffer containing sufficient pixel values so that the buffer can be processed using the accelerated hardware or specialized CPU instructions. Another prior art approach to process tiles is to simply not use the accelerated hardware or specialized CPU instructions and suffer the reduced performance.
The construction of the memory buffer using information assembled from the source tile and adjacent source tiles consumes computer resources. The term "cobbling" refers to the process of assembling such a buffer. For example, one prior art approach to this problem is to read every source tile that contains any of the image data required to generate the pixel values in the destination into a contiguous buffer in memory. This approach consumes large contiguous amounts of memory. Another prior art approach is to first create a temporary memory buffer that is just large enough to hold all the necessary source pixel values required for the image operation. Then, to copy the appropriate source pixel values from the multiple tiles to the temporary memory buffer. Once in the memory buffer, the pixel values can be processed as a whole. Although this approach reduces the amount of contiguous memory, the overhead of copying complete tiles from one memory buffer to another is significant. Yet another prior art approach is to store the source tiles with overlapping boarders (containing pixel values from other tiles) to provide the pixel values required by the source pixel contribution map. Thus, every tile consumes more memory that would otherwise be required. These approaches all require significant memory or tile disk access overheads to cobble together memory buffers that are suitable for area-image operations. In addition, image accelerator devices (such as MMX-like computer instructions or other specialized image processing hardware) do not have the capability of performing area-image operations across tile edges and thus are tile-unaware.
It would be advantageous to provide methods, mechanisms, and computer program products that permit area-image operations to be efficiently applied to tiled images. Thus, it would be advantageous to use graphical accelerator devices, image processing computer instructions or some combination thereof on tiled images. In addition, it would be advantageous to use tile-unaware technology to process tiled images. It would also be advantageous to reduce the overhead related to creating these memory buffers and to reduce the number of special-case conditions within the processing code. These techniques also improve the efficiency of a computer that performs such area-image operations. The efficiency is improved by reducing the amount of pixel data that is copied from one memory buffer to another by the area-image operation and by improving the efficiency of the executing area-image operation code.